<template>
  <div id="register">
    <div class="main">
      <div class="content">
        <div class="content-left">
          <div class="logo">
            <img src="../assets/img/login&register/svg/logo-white.svg" alt="" />
          </div>
          <div class="carousel">
            <!-- <img src="../assets/img/login&register/img/ia_10002.jpg" alt="" /> -->
            <template>
              <a-carousel arrows autoplay>
                <div
                  slot="prevArrow"
                  class="custom-slick-arrow"
                  style="left: 10px;zIndex: 1"
                >
                  <a-icon type="left-circle" />
                </div>
                <div slot="nextArrow" class="custom-slick-arrow" style="right: 10px">
                  <a-icon type="right-circle" />
                </div>
                <div v-for="item in CarouselList" :key="item.id">
                    <div class="img" v-if="CarouselList.length>0" :style="`background:url(${item.s_photos[0].path}) no-repeat 0 0/cover`"></div>
                </div>
                <!-- <img v-for="item in CarouselList" :key="item.id" :src="item.s_photos[0].path" alt=""> -->
              </a-carousel>
            </template>
          </div>
        </div>
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
import {getCarousel} from '../assets/js/request.js'
export default {
  data() {
    return {
      CarouselList:[],
    }
  },
  async created() {
    // 获取轮播图
    let Carousel = await getCarousel("index");
    console.log(Carousel);
    let a = Carousel.filter((ele,index)=>{
        if(index>3 && index<8) {
            return ele
        }
    })
    this.CarouselList = a
    console.log(this.CarouselList);
    // 登录请求
    let carousel = await getCarousel("登录注册");
    console.log(carousel);
  }
};
</script>

<style lang="scss" scoped>
#register {
  .main {
    padding: 100px 0 80px;
    .content {
      background-color: white;
      width: 1200px;
      margin: 0px auto;
      display: flex;
      justify-content: space-between;
      .content-left {
        position: relative;
        width: 50%;
        .logo {
          padding: 24px;
          position: absolute;
          top: 0;
          left: 0;
          z-index: 10;
          img {
            width: 70px;
          }
        }
        .carousel {
          // width: 50%;
          img {
            width: 100%;
          }
        }
      }
    }
  }
}
</style>
<style scoped>
/* For demo */
.ant-carousel >>> .slick-slide {
  text-align: center;
  /* height: 100%; */
  background: #364d79;
  overflow: hidden;
}

.ant-carousel >>> .custom-slick-arrow {
  width: 25px;
  height: 25px;
  font-size: 25px;
  color: #fff;
  background-color: rgba(31, 45, 61, 0.11);
  opacity: 0.3;
}
.ant-carousel >>> .custom-slick-arrow:before {
  display: none;
}
.ant-carousel >>> .custom-slick-arrow:hover {
  opacity: 0.5;
}

.ant-carousel >>> .slick-slide .img {
  /* color: #fff; */
  height: 780px;
}
</style>